<?php
/**
 * Created by PhpStorm.
 * Author: Wudean
 * Date: 2018/6/8 0008
 * Time: 14:07
 * Name: Mapi
 */

Route::group(['prefix' => 'wxapi', 'namespace' => 'Mapi', 'middleware' => ['cors']], function () {

    //用户授权
    Route::any('wx-login', 'LoginController@wxLogin');
    /**
     * @name 公共文件上传
     */
    Route::post('upload-file', 'SystemController@uploadFile');

    //主开接口
    Route::group(['middleware' => ['wapi.login']], function () {
        /**
         * @name 获取押韵数据
         */
        Route::post('get-rhyme-lists', 'RhymeController@getKwd');
        /**
         * @name 用户信息
         */
        Route::post('user-info', 'WxUsersController@getUserInfo');

        /**
         * Beat - 添加
         */
        Route::post('beat-create', 'BeatController@BeatCreate');
        /**
         * Beat - 删除
         */
        Route::post('beat-delete', 'BeatController@BeatDelete');
        /**
         * Beat - 列表数据 - 按收藏量排序
         */
        Route::post('beat-lists', 'BeatController@BeatLists');
        /**
         * Beat - 点击播放操作
         */
        Route::post('beat-click', 'BeatController@BeatClick');

        /**
         * Beat - 详情接口
         */
        Route::post('beat-info', 'BeatController@BeatInfo');

        /**
         * Beat - 详情数据
         */
        /**
         * 混编 - 点击播放操作
         */
        Route::post('music-click', 'BeatController@MusicClick');

        /**
         * 收藏处理 - Beat收藏
         */
        Route::post('collection-beat-create', 'CollectionController@CollectionBeatCreate');

        /**
         * 收藏处理 - Music收藏
         */
        Route::post('collection-music-create', 'CollectionController@CollectionMusicCreate');
        /**
         * 收藏处理 - Beat取消收藏
         */
        Route::post('collection-beat-delete', 'CollectionController@CollectionBeatDelete');
        /**
         * 收藏处理 - Music取消收藏
         */
        Route::post('collection-music-delete', 'CollectionController@CollectionMusicDelete');
        Route::get('collection-list', 'CollectionController@CollectionLists');
        /**
         * 歌词创作  - 添加
         */
        Route::post('lyric-create', 'LyricController@LyricCreate');

        /**
         * 歌词创作  - 列表
         */
        Route::post('lyric-lists', 'LyricController@LyricLists');
        /**
         * 歌词创作  - 详情
         */
        Route::post('lyric-info', 'LyricController@LyricInfo');
        /**
         * 歌词创作  - 删除
         */
        Route::post('lyric-delete', 'LyricController@LyricDelete');
        /**
         * 歌词创作  - 编辑
         */
        Route::post('lyric-update', 'LyricController@LyricEdit');

        /**
         * 音乐  - 添加
         */
        Route::post('music-create', 'MusicController@MusicCreate');
        /**
         * 音乐  - 列表
         */
        Route::get('music-lists', 'MusicController@MusicLists');
        /**
         * 音乐  - 详情
         */
        Route::get('music-info', 'MusicController@MusicInfo');
        /**
         * 音乐  - 删除
         */
        Route::post('music-delete', 'MusicController@MusicDelete');
        /**
         * 音乐  - 编辑
         */
        Route::post('music-update', 'MusicController@MusicEdit');
        /**
         * 分享  - 记录
         */
        Route::post('music-share-add', 'MusicController@MusicShareAdd');

        Route::get('get-qrcode', 'SystemController@getQrCode');
        /**
         * Demo
         */
        Route::post('demo', function(){
            dd("end");
        });
    });

});
